3.4 \(\int \cot (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=40 \[ a x (B+i A)+\frac {a A \log (\sin (c+d x))}{d}-\frac {i a B \log (\cos (c+d x))}{d} \]

[Out]

a*(I*A+B)*x-I*a*B*ln(cos(d*x+c))/d+a*A*ln(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3589, 3475, 3531} \[ a x (B+i A)+\frac {a A \log (\sin (c+d x))}{d}-\frac {i a B \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

a*(I*A + B)*x - (I*a*B*Log[Cos[c + d*x]])/d + (a*A*Log[Sin[c + d*x]])/d

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3589

Int[(((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]))/((a_.) + (b_.)*tan[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Dist[(B*d)/b, Int[Tan[e + f*x], x], x] + Dist[1/b, Int[Simp[A*b*c + (A*b*d + B*(
b*c - a*d))*Tan[e + f*x], x]/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a
*d, 0]

Rubi steps

\begin {align*} \int \cot (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=(i a B) \int \tan (c+d x) \, dx+\int \cot (c+d x) (a A+a (i A+B) \tan (c+d x)) \, dx\\ &=a (i A+B) x-\frac {i a B \log (\cos (c+d x))}{d}+(a A) \int \cot (c+d x) \, dx\\ &=a (i A+B) x-\frac {i a B \log (\cos (c+d x))}{d}+\frac {a A \log (\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 49, normalized size = 1.22 \[ \frac {a A (\log (\tan (c+d x))+\log (\cos (c+d x)))}{d}+i a A x-\frac {i a B \log (\cos (c+d x))}{d}+a B x \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

I*a*A*x + a*B*x - (I*a*B*Log[Cos[c + d*x]])/d + (a*A*(Log[Cos[c + d*x]] + Log[Tan[c + d*x]]))/d

________________________________________________________________________________________

fricas [A]  time = 0.56, size = 36, normalized size = 0.90 \[ \frac {-i \, B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

(-I*B*a*log(e^(2*I*d*x + 2*I*c) + 1) + A*a*log(e^(2*I*d*x + 2*I*c) - 1))/d

________________________________________________________________________________________

giac [B]  time = 0.41, size = 74, normalized size = 1.85 \[ -\frac {i \, B a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) + i \, B a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) - A a \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) + 2 \, {\left (A a - i \, B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

-(I*B*a*log(tan(1/2*d*x + 1/2*c) + 1) + I*B*a*log(tan(1/2*d*x + 1/2*c) - 1) - A*a*log(tan(1/2*d*x + 1/2*c)) +
2*(A*a - I*B*a)*log(tan(1/2*d*x + 1/2*c) + I))/d

________________________________________________________________________________________

maple [A]  time = 0.42, size = 56, normalized size = 1.40 \[ i A a x +\frac {i A a c}{d}-\frac {i a B \ln \left (\cos \left (d x +c \right )\right )}{d}+a B x +\frac {a A \ln \left (\sin \left (d x +c \right )\right )}{d}+\frac {B a c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

I*A*a*x+I/d*A*a*c-I*a*B*ln(cos(d*x+c))/d+a*B*x+a*A*ln(sin(d*x+c))/d+1/d*B*a*c

________________________________________________________________________________________

maxima [A]  time = 0.57, size = 49, normalized size = 1.22 \[ \frac {2 \, {\left (d x + c\right )} {\left (i \, A + B\right )} a - {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, A a \log \left (\tan \left (d x + c\right )\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*(I*A + B)*a - (A - I*B)*a*log(tan(d*x + c)^2 + 1) + 2*A*a*log(tan(d*x + c)))/d

________________________________________________________________________________________

mupad [B]  time = 6.23, size = 36, normalized size = 0.90 \[ \frac {A\,a\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {a\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i),x)

[Out]

(A*a*log(tan(c + d*x)))/d - (a*log(tan(c + d*x) + 1i)*(A - B*1i))/d

________________________________________________________________________________________

sympy [B]  time = 1.94, size = 97, normalized size = 2.42 \[ \frac {A a \log {\left (\frac {A a + i B a}{- A a e^{2 i c} - i B a e^{2 i c}} + e^{2 i d x} \right )}}{d} - \frac {i B a \log {\left (\frac {- A a - i B a}{- A a e^{2 i c} - i B a e^{2 i c}} + e^{2 i d x} \right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

A*a*log((A*a + I*B*a)/(-A*a*exp(2*I*c) - I*B*a*exp(2*I*c)) + exp(2*I*d*x))/d - I*B*a*log((-A*a - I*B*a)/(-A*a*
exp(2*I*c) - I*B*a*exp(2*I*c)) + exp(2*I*d*x))/d

________________________________________________________________________________________